#include "customtreeview.h"
#include <QContextMenuEvent>

QCustomTreeView::QCustomTreeView(MainWindow * window)
{
    this->window = window;
}

void QCustomTreeView::contextMenuEvent(QContextMenuEvent *event)
{
    if(!indexAt(event->pos()).isValid())
        return;
    QMenu menu(this);
    menu.addAction(window->renameAction);
    menu.addAction(window->copyAction);
    menu.addAction(window->moveAction);
    menu.addAction(window->deleteAction);
    menu.exec(event->globalPos());
}
